<template>
	<div>
		<button @click="isShow = !isShow">显示/隐藏</button>
		<transition name="chao">
			<h2 v-show="isShow">欢迎您学习Vue</h2>
		</transition>
	</div>
</template>

<script>
	export default {
		name:'App',
		data() {
			return {
				isShow:true
			}
		},
	}
</script>

<style>
	h2{
		width: 300px;
		background-color: orange;
	}
	@keyframes peiqi {
		from{
			transform: translateX(0px);
		}
		to{
			transform: translateX(-300px);
		}
	}
	.chao-leave-active{
		animation: peiqi 3s linear;
	}
	.chao-enter-active{
		animation: peiqi 3s linear reverse;
	}
</style>